// home模块的仓库
import {reqCategoryList,reqGetBannerList,reqGetFloorList} from '@/api/request'
const state = {
    categoryList:[],
    bannerList:[],
    floorList:[],
}
const mutations = {
    CATEGORY(state,categoryList){
        state.categoryList = categoryList
    },
    GETBANNERLIST(state,BannerList){
        state.bannerList = BannerList
    },
    GETFLOORLIST(state,FloorList){
        state.floorList = FloorList
    }
}
const actions = {
    async category({commit}){
        let result = await reqCategoryList()
        if(result.code===200){
            commit('CATEGORY',result.data)
        }
    },
    async getBannerList({commit}){
        let result = await reqGetBannerList()
        if(result.code===200){
            commit('GETBANNERLIST', result.data)
        }
    },
    async getFloorList({commit}){
        let result = await reqGetFloorList()
        if(result.code===200){
            commit('GETFLOORLIST', result.data)
        }
    }
}
const getters = {}

export default {
    state,
    mutations,
    actions,
    getters,
}